package com.kx.decorator_mode;

/**
 * Created on 2021/10/21.
 *
 * @author KaiXuan Xiao
 */
public abstract class Decorator implements Component {

    private Component component;

    public void setComponent(Component component) {
        this.component = component;
    }

    @Override
    public void operation() {
        if (component!=null){
            component.operation();
        }
    }
}
